#!  /usr/bin/env lua
--[[
https://github.com/starwing/luautf8
--]]
local setmetatable=setmetatable;
local _M={_VERSION="1.0"};
local _mt={__index=_M};
setmetatable(_M,_mt);

local utf8 = require("lua-utf8")

function _M.byte(...)
    return utf8.byte(...)
end

function _M.char(...)
    return utf8.char(...)
end

function _M.find(...)
    return utf8.find(...)
end

function _M.gmatch(...)
    return utf8.gmatch(...)
end

function _M.gsub(...)
    return utf8.gsub(...)
end

function _M.len(...)
    return utf8.len(...)
end

function _M.lower(...)
    return utf8.lower(...)
end

function _M.match(...)
    return utf8.match(...)
end

function _M.reverse(...)
    return utf8.reverse(...)
end

function _M.reverse(...)
    return utf8.reverse(...)
end

function _M.sub(...)
    return utf8.sub(...)
end

function _M.upper(...)
    return utf8.upper(...)
end

--[===[
utf8.escape(str) -> utf8 string
--]===]
function _M.escape(str)
    return utf8.escape(str)
end

--[===[
utf8.charpos(s[[, charpos], offset]) -> charpos, code point
--]===]
function _M.charpos(s, charpos, offset)
    return utf8.charpos(s, charpos, offset)
end

--[===[
utf8.next(s[, charpos[, offset]]) -> charpos, code point
--]===]
function _M.next(s, charpos, offset)
    return utf8.next(s, charpos, offset)
end

--[===[
utf8.insert(s[, idx], substring) -> new_string
--]===]
function _M.insert(s, idx, substring)
    return utf8.insert(s, idx, substring)
end

--[===[
utf8.remove(s[, start[, stop]]) -> new_string
--]===]
function _M.remove(s, start, stop)
    return utf8.remove(s, start, stop)
end

--[===[
utf8.width(s[, ambi_is_double[, default_width]]) -> width
--]===]
function _M.width(s, ambi_is_double, default_width)
    return utf8.width(s, ambi_is_double, default_width)
end

--[===[
utf8.widthindex(s, location[, ambi_is_double[, default_width]]) -> idx, offset, width
--]===]
function _M.widthindex(s, location, ambi_is_double, default_width)
    return utf8.widthindex(s, location, ambi_is_double, default_width)
end

--[===[
utf8.title(s) -> new_string
--]===]
function _M.title(s)
    return utf8.title(s)
end

--[===[
utf8.fold(s) -> new_string
convert UTF-8 string s to title-case, or folded case used to compare by ignore case. if s is a number,
it's treat as a code point and return a convert code point (number). utf8.lower/utf8.upper has the
same extension.
--]===]
function _M.fold(s)
    return utf8.fold(s)
end

--[===[
utf8.ncasecmp(a, b) -> [-1,0,1]
compare a and b without case, -1 means a < b, 0 means a == b and 1 means a > b.
--]===]
function _M.ncasecmp(a, b)
    return utf8.ncasecmp(a, b)
end



return _M;